package com.jk.service.impl;

import com.github.pagehelper.PageHelper;
import com.jk.bean.WenShiLunBo;
import com.jk.mapper.WenShiMapper;
import com.jk.service.WenShiService;
import com.jk.utils.ReceivePage;
import com.jk.utils.SendPage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Description: 骚骚的🐏
 * @Author: 杨
 * @Date: 2019/3/16 21:07
 */
@Service
public class WenShiServiceImpl implements WenShiService {
   @Autowired
    private WenShiMapper wenShiMapper;

    @Override
    public SendPage queryLunBo(WenShiLunBo wenShiLunBo, ReceivePage rp) {
        List<WenShiLunBo> countlist=wenShiMapper.queryLunBo(wenShiLunBo);
        PageHelper.startPage(rp.getPage(),rp.getRows());
        List<WenShiLunBo> list=wenShiMapper.queryLunBo(wenShiLunBo);
        return new SendPage(countlist.size(), list);
    }

    @Override
    public void addwsLunBo(WenShiLunBo wenShiLunBo) {
        wenShiMapper.addwsLunBo(wenShiLunBo);
    }
}
